Representation inheritance: a safe form of "white box" code inheritance

نویسنده

  • Stephen H. Edwards
چکیده

Inheritance as a programming language mechanism can be used to achieve several di erent goals, both in terms of expressing relationships between components and in terms of de ning new components \by di erence" from existing ones. For de ning new component implementations in terms of existing implementations, there are several approaches to using \code inheritance." Black box code inheritance allows subclasses to reuse superclass implementations as-is, without direct access to their internals. Alternatively, white box code inheritance allows subclasses to have direct access to superclass implementation details, which may be necessary for the e ciency of some subclass operations. Unfortunately, white box code inheritance violates the encapsulation protection a orded to superclasses, opening up the possibility for subclasses to interfere with the correct operation of superclass methods. Representation inheritance is proposed as a restricted form of white box code inheritance where subclasses have direct access to superclass implementation details, but are required to respect the representation invariant(s) and abstraction function(s) of their ancestor(s). This preserves the protection that encapsulation would have provided, while allowing the freedom of access that component implementers sometimes desire.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Study of Patterns of Inheritance in Affected Patients with Retinitis Pigmentosa in Iranian Populations

Background and Aims: Retinitis pigmentosa (RP) is the most common form of inherited retinal degeneration, photoreceptors loss of which in the retina causes visual loss. The purpose of the present study was to determine patterns of inheritance in RP patients in Yazd to help the health professional for designing suitable laboratory testing for the high risk families. Materials and Methods: Thirt...

متن کامل

Documentation Inheritance in Literate Programs

Object-oriented programming has resulted in the reuse of class libraries and application frameworks. This can considerably improve the productivity in software development. Black-box reuse boosts productivity more than white-box reuse. However, white-box reuse is the usual means of dealing with common parts in di erent applications, assuming that the same developers are building these applicati...

متن کامل

Co-inheritance of --MED double gene deletion and αααAnti3.7 triplication on α-globin gene in Mazandaran at 2016

Alpha Thalassemia is one of the most prevalent disorders worldwide with a [T1] high carrier rate in Mazandaran province (north of Iran). Carriers of --MED double gene deletion are at risk of having a child with hemoglobin  haemoglobin[T2]  H (HbH) disease, if they marry a silent carrier. Co-inheritance of αααAnti3.7 triplication that cannot be detected using hem...

متن کامل

An analytical study on differences of fariqain on Divine messengers` inheritance in Quran

Some verses of Quran, including the sixteenth of Naml and the sixth of Maryam, have clearly referred to messengers` inheritance. The subject has been viewed differently by Sunni and Shiite commentators. Two hypotheses can be presented in the field, one knowing them as usual men and the other as those of higher degree for God. On the former one can speak of their inheritance. They inherit and le...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1996